package com.A1908.util;

import com.A1908.dao.AttendPeopleInfoDao;
import com.A1908.dao.FeastInfoDao;
import com.A1908.dao.UserDao;
import com.A1908.dao.impl.AttendPeopleInfoDaoImpl;
import com.A1908.dao.impl.DataAnalysisDaoImpl;
import com.A1908.dao.impl.FeastInfoDaoImpl;
import com.A1908.dao.impl.UserDaoImpl;
import com.A1908.entity.*;
import com.A1908.service.*;
import com.A1908.service.impl.*;

import java.io.FileOutputStream;
import java.util.List;

/**
 * @name:
 * @description:
 * @author: mr.ck
 * @title: talk is cheap, show me the code!!!
 * @time: 2021-03-26 13:47:26
 */


public class TestMain {
    public static void main(String[] args) {
//        User user = new User();
//        user.setId(100000);
//        FeastInfoDataAnalysis feastAnalysis = new FeastInfoServiceImpl().getFeastAnalysis(user);

//        MyAttendService myAttendService = new MyAttendServiceImpl();
//        MyAttend myAttend = new MyAttend();
//        myAttend.setMyUserID(100000);
//        List<MyAttend> list = myAttendService.findAllMyAttend(myAttend);
//        if (list.size() > 0){
//            System.out.println(true);
//        }else {
//            System.out.println(false);
//        }

//        RelationService relationService = new RelationServiceImpl();
//        List<RelationType> list = relationService.findAllRelationInfo();
//        if (list.size() > 0){
//            System.out.println(true);
//        }else {
//            System.out.println(false);
//        }

//        AttendPeopleInfoService peopleInfoService = new AttendPeopleServiceImpl();
//        FeastInfo feastInfo = new FeastInfo();
//        feastInfo.setId(3);
//        List<AttendPeopleInfo> list = peopleInfoService.findAttendPeopleInfoByFeast(feastInfo);
//        if (list.size() > 0){
//            System.out.println(true);
//        }else {
//            System.out.println(false);
//        }

        /*UserFeastTypeService feastTypeService = new UserFeastTypeServiceImpl();
        List<UserFeastType> list = feastTypeService.findAllFeastType();
        if (list.size() > 0){
            System.out.println(true);
        }else {
            System.out.println(false);
        }*/
        /*//测试查询全部关系信息
        RelationService relationService = new RelationServiceImpl();
        List<Relation> list = relationService.findAllRelationInfo();
        if (list.size() > 0){
            System.out.println(true);
        }else {
            System.out.println(false);
        }
        可用*/

//        测试查询全部宴会信息
//        FeastInfoService infoService = new FeastInfoServiceImpl();
//        List<FeastInfo> list = infoService.findAllFeastInfo();
//        if (list.size() > 0){
//            System.out.println(true);
//        }else {
//            System.out.println(false);
//        }
//        可用

        /*测试修改宴会*/
/*        FeastInfoService infoService = new FeastInfoServiceImpl();
        List<FeastInfo> list = infoService.findAllFeastInfo();
        if (list.size() > 0){
            System.out.println(true);
        }else {
            System.out.println(false);
        }
        亲测可用！*/


        /*测试添加参会人*/
/*        AttendPeopleInfoDao attendPeopleInfoDao=new AttendPeopleInfoDaoImpl();
        AttendPeopleInfo attendPeopleInfo=new AttendPeopleInfo();
        attendPeopleInfo.setAttendPeople("王二狗");
        attendPeopleInfo.setAttendDate("2020-03-31");
        attendPeopleInfo.setAttendFeast(2);
        attendPeopleInfo.setGift(300.00);
        attendPeopleInfo.setNote("无");
        attendPeopleInfo.setRelationID(1);
        attendPeopleInfoDao.addAttendPeople(attendPeopleInfo);
        亲测可用！*/

        /*测试取得参会人信息*/

//        AttendPeopleInfoDao attendPeopleInfoDao=new AttendPeopleInfoDaoImpl();
//        User user=new User();
//        user.setId(100000);
//        List<AttendPeopleInfo> list = attendPeopleInfoDao.getAllAttendPeopleInfo(user);
//        System.out.println(list);
//        亲测可用！


//        System.out.println(MD5util.encrypt("admin")); MD5加密 亲测可用~

//        测试出席人分页
//        AttendPeopleInfoService attendPeopleInfoService=new AttendPeopleServiceImpl();
//        User user=new User();
//        user.setId(100000);
//        PageEntity pageEntity=new PageEntity();
//        pageEntity.setCurrentPage(1);
//        pageEntity.setPageSize(2);
//        attendPeopleInfoService.getAllAttendPeopleInfo(user,pageEntity);
//        亲测可用


//        测试宴会信息分页
//        FeastInfoService infoService=new FeastInfoServiceImpl();
//        User user=new User();
//        user.setId(100000);
//        PageEntity pageEntity=new PageEntity();
//        pageEntity.setCurrentPage(1);
//        pageEntity.setPageSize(1);
//        List<FeastInfo> list= infoService.findAllFeastInfo(user,pageEntity);
//        亲测可用

//        DataAnalysisServiceImpl dataAnalysisService=new DataAnalysisServiceImpl();
//        User user=new User();
//        user.setId(100000);
//        dataAnalysisService.totalData(user);
//
//        SendMsgServiceImpl sendMsgService=new SendMsgServiceImpl();
//        for (int i=0;i<1;i++){
//            Email email=new Email();
//            email.setEmailText("666666666666");
//            email.setSendAddress("2648414923@qq.com");
//            email.setEmailTitle("测试");
//            sendMsgService.sendByEmail(email);
//        }
//        UserDaoImpl userDao=new UserDaoImpl();
//        User u=new User();
//        u.setPhoneNumber("18585850001");
//        u.setPassword("admin");
//        User user=userDao.findUser(u);
//        user.setUsername("大聪明");
//
//        userDao.editUser(user);

//        GetEmail getEmail=new GetEmail();
//        try {
//            getEmail.getEmail();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

//        FeastInfoServiceImpl feastInfoService=new FeastInfoServiceImpl();
//        User user=new User();
//        user.setId(100000);
//        FeastInfoDataAnalysis dataAnalysis= feastInfoService.getFeastAnalysis(user);
    }
}
